import request from '@/utils/request'

/**
 * 创建微信支付订单
 * @param {Object} data - 支付参数 { orderId, openid }
 */
export function createWxPayOrder(data) {
  return request.post('/payment/wxpay/create', data)
}

/**
 * 查询订单支付状态
 * @param {String} orderId - 订单ID
 */
export function queryPayStatus(orderId) {
  return request.get(`/payment/wxpay/query/${orderId}`)
}

/**
 * 申请退款
 * @param {String} orderId - 订单ID
 * @param {String} reason - 退款原因
 */
export function refund(orderId, reason) {
  return request.post(`/payment/wxpay/refund/${orderId}`, { reason })
}

